package com.supcon.tea.work.questionnaire.domain.dto;

import com.supcon.tea.work.questionnaire.domain.Answer;
import com.supcon.tea.work.questionnaire.domain.vo.AnswerVO;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * Created by zhengjian1 on 2017/7/25.
 * 前端不管是不传，还是传空的字符串，都为null。
 */
public class AnswerDTO {
    @NotNull(message = "用户id不能为空")
    private String userId;

    @NotNull(message = "问卷id不能为空")
    @Range(min=1,max=2,message = "问卷id不存在")
    private Integer questionnaireId;

    @NotNull(message = "问卷nums不能为空")
    @Range(min=1,max=66,message = "问卷总数不对")
    private Integer nums;

    @NotNull(message = "请提交至少一个答案")
    private List<AnswerVO> answers;

    public String getUserId() {
        return userId;
    }

    public Integer getQuestionnaireId() {
        return questionnaireId;
    }

    public Integer getNums() {
        return nums;
    }

    public List<AnswerVO> getAnswers() {
        return answers;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public void setQuestionnaireId(Integer questionnaireId) {
        this.questionnaireId = questionnaireId;
    }

    public void setAnswers(List<AnswerVO> answers) {
        this.answers = answers;
    }

    public void setNums(Integer nums) {
        this.nums = nums;
    }

    @Override
    public String toString() {
        return "AnswerDTO{" +
                "userId='" + userId + '\'' +
                ", questionnaireId='" + questionnaireId + '\'' +
                ", nums=" + nums +
                ", answers=" + answers +
                '}';
    }
}
